home *** CD-ROM | disk | FTP | other *** search
/ 3D World 113 / 3DW_113.iso / pc / Menu / Scenes / home.dir / Internal_44_Media Controls.ls < prev    next >
Encoding:
Text File  |  2008-09-12  |  1.5 KB  |  70 lines

  1. global gRootPath, gDiv, mp3List, selecta
  2.  
  3. on stopMovie
  4.   repeat with i = 1 to the number of castMembers of castLib 5
  5.     member(i, 5).erase()
  6.   end repeat
  7. end
  8.  
  9. on InitMediaPlayer
  10.   repeat with i = 1 to the number of castMembers of castLib 5
  11.     member(i, 5).erase()
  12.   end repeat
  13.   mp3List = []
  14.   thePath = gRootPath & "DiscContent" & gDiv & "Resources" & gDiv & "PodCasts" & gDiv
  15.   u = getNetText(thePath & "playlist.txt")
  16.   if netDone(u) then
  17.     c = netTextResult(u)
  18.   end if
  19.   iCount = 1
  20.   repeat with i = 1 to c.line.count
  21.     mp3List[iCount] = [:]
  22.     mp3List[iCount][#pTitle] = c.line[i]
  23.     i = i + 1
  24.     o = new(#sound, castLib(5))
  25.     o.fileName = thePath & c.line[i]
  26.     mp3List[iCount][#pFilename] = o
  27.     iCount = iCount + 1
  28.   end repeat
  29.   selecta = 1
  30.   put mp3List[1].pFilename
  31.   sound(2).queue(mp3List[1].pFilename)
  32.   member("tickertape").text = "Click the 'play' button to begin playing the podcasts"
  33.   put "MP3 Player Done"
  34. end
  35.  
  36. on PlayMedia
  37.   sound(2).play()
  38.   member("tickertape").text = mp3List[selecta].pTitle
  39. end
  40.  
  41. on PauseMedia
  42.   sound(2).pause()
  43. end
  44.  
  45. on NextMedia
  46.   selecta = selecta + 1
  47.   if selecta > mp3List.count then
  48.     selecta = 1
  49.   end if
  50.   sound(2).stop()
  51.   sound(2).queue(mp3List[selecta].pFilename)
  52.   member("tickertape").text = mp3List[selecta].pTitle
  53.   sound(2).play()
  54. end
  55.  
  56. on PrevMedia
  57.   selecta = selecta - 1
  58.   if selecta < 1 then
  59.     selecta = mp3List.count
  60.   end if
  61.   sound(2).stop()
  62.   sound(2).queue(mp3List[selecta].pFilename)
  63.   member("tickertape").text = mp3List[selecta].pTitle
  64.   sound(2).play()
  65. end
  66.  
  67. on StopMedia
  68.   sound(2).stop()
  69. end
  70.